<template>
  <el-form>
    <el-form-item label="用户名">
      <el-input
        v-model.trim="jira_config.username"
        tabindex="1" />
    </el-form-item>
    <el-form-item label="密码">
      <el-input
        v-model.trim="jira_config.password"
        type="password"
        placeholder="密码"
        :show-password="true"
        auto-complete="on"
        tabindex="2"
        prefix-icon="el-icon-lock" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="connect">测试连接</el-button>
      <el-button type="secondary" @click="submit">保存</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  props: {
    jira_config: {
      type: Object,
      default: () => {
        return {
          username: '',
          password: ''
        }
      }
    }
  },
  methods: {
    submit() {
      this.$message({
        message: 'Jira Connect info updated successfully',
        type: 'success',
        duration: 5 * 1000
      })
    },
    connect() {
      this.$message({
        message: 'Connect Jira successfully',
        type: 'success',
        duration: 5 * 1000
      })
    }
  }
}
</script>
